<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
    <link rel="apple-touch-icon-precomposed" href="./icon.png" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-title" content="" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title>shanghai</title>
    <link rel="stylesheet" href="/bs/css//iconfont.css">
    <link rel="stylesheet" href="../bs/css//bootstrap.css">
    <script src="../bs/js/jquery-3.6.0.min.js"></script>
    <script src="../bs/js/bootstrap.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: PingFangSC-Regular, Verdana, Arial, '微软雅黑', '宋体';
        }

        html,
        body {
            height: 100vh;
            overflow: hidden;
            padding-bottom: env(safe-area-inset-bottom);
            padding-bottom: constant(safe-area-inset-bottom);
            overflow-y: auto;
        }

        .body {
            padding: 0 20vw;
            padding-bottom: 12px;
            min-height: 100%;
        }

        .info {
            padding: 20px;
            font-size: 22px;
            background-image: url({{data.thumb}});
            height: 230px;
            color: #ffffff;
            background-repeat: no-repeat;
            background-size: cover;
            background-position: center;
        }

        .post-list {
            display: flex;
            flex-wrap: wrap;
        }

        .no-data {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            padding: 200px;
            background-color: #f5f5f5;
            color: #666666;
        }

        .post-item {
            margin-right: 12px;
            margin-top: 12px;
            padding: 12px;
            border: 1px solid #ebebeb;
            width: calc((100% - 24px) / 3);
            height: 290px;

            border-radius: 8px;

            display: -webkit-box;
            overflow: hidden;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            text-overflow: ellipsis;
        }

        .post-item:nth-child(3n+3) {
            margin-right: 0;
        }

        .post-item-title {
            font-size: 22px;
            font-weight: bold;
            padding: 10px 0;
        }
    </style>

    <script>
        function loadPostDetail(pid) {
            window.location.href = "/post/" + pid;
        }
        function loadLast() {
            window.history.go(-1);
        }
    </script>
</head>

<body>
    {% include 'view/menu.html'%}
    <div class="body">
        <i class="iconfont icon-60fanhui-1" style="font-size: 26px;cursor: pointer;" onclick="loadLast()"></i>
        <div class="info">
            <div>{{data.name}}</div>
        </div>
        <div style="height: 1px;background-color: #ebebeb;margin-top:12px;margin-bottom: 12px;"></div>
        {% if list|length > 0 %}
        <div class="post-list">

            {% set obj=list[0]%}
            {% for i in range(0,20) %}
            <div class="post-item" onclick="loadPostDetail('{{obj.pid}}')">
                <div class="post-item-title">
                    {{obj.title}}
                </div>
                {{obj.content}}
            </div>
            {% endfor %}
        </div>
        {% else %}
        <div class="no-data">no data</div>
        {% endif %}

    </div>



    {% include 'view/foot.html'%}

</body>

</html>